package com.youyi.yyviewsdklibrary.Dialog.core;

import android.app.Dialog;

public class XDialog {
    private BasePopupView mBasePopupView;
    private Dialog mDialog;

    public XDialog(BasePopupView basePopupView, Dialog dialog) {
        this.mBasePopupView = basePopupView;
        this.mDialog = dialog;
    }

    public BasePopupView getBasePopupView() {
        return this.mBasePopupView;
    }

    public void setBasePopupView(BasePopupView basePopupView) {
        this.mBasePopupView = basePopupView;
    }

    public Dialog getDialog() {
        return this.mDialog;
    }

    public void setDialog(Dialog dialog) {
        this.mDialog = dialog;
    }

    public void setCancelable(boolean z) {
        Dialog dialog = this.mDialog;
        if (dialog != null) {
            dialog.setCancelable(z);
        }
    }

    public void dismiss() {
        try {
            BasePopupView basePopupView = this.mBasePopupView;
            if (basePopupView != null) {
                basePopupView.dismiss();
            }
            Dialog dialog = this.mDialog;
            if (dialog != null) {
                dialog.dismiss();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
